Update Master Location
/locations/{id}
As a Customer of iFoodDS, you use the iFoodDS Master Location API to update FSMA 204 master location data in the iFoodDS Trace Exchange platform. Records will be stored for a minimum of two years.
This endpoint is being refined and thus subject to change. These docs will update when changes are made.
Request
Type: application/json
The {id}
of the path is the ID retrieved from:
- Completion of a succesful POST. Example:
"request_ids": ["9ed5911f-f6a4-4ba2-9eb4-d6428237be28"]
- Within the payload results of a GET. Example:
"id": "7b5c43c3-3526-4135-a602-0e3979c21d88"
The body of the request comprises one section: the locationMasterList
.
{
"locationMasterList": {
"locationName": "<location name>",
"locationCode": "<location code>",
"businessUnit": "<business unit>",
"market": "<market>",
"region": "<region>",
"locationType": "<location type>",
"parentLocationId": "<parent location id>",
"gln": "<GLN (global location number)>",
"glnAssignedBy": "<GLN assigned by>",
"duns": "<DUNS number>",
"alternateLocationCode": "<alternate location code>",
"phoneNumber": "<phone number>",
"isPrimaryLocation": true,
"isCoveredByGdst": false,
"address": {
"streetAddress1": "<street address 1>",
"streetAddress2": "<street address 2>",
"city": "<city>",
"state": "<state>",
"postalCode": "<postal code>",
"country": "<country code>"
},
"geoLocation": {
"gpsCoordinates": [
"<latitude>",
"<longitude>"
],
"geoFence": [
[
"<latitude1>",
"<longitude1>"
],
[
"<latitude2>",
"<longitude2>"
],
[
"<latitude3>",
"<longitude3>"
]
]
}
}
}
Data Constraints
Please note the following data constraints:
strings
allow a maximum of 100 characters
Location Data
Required
locationName
(string): Name of vendor's or purchaser's location referenced in the recordlocationCode
(string): Vendor's or purchaser's location code referenced in the record
If address and contact information is already set up in master data with locationCode
, then the address information is not required. Otherwise, it is required. Provide at least one of the following:
gln
(string): GS1 Global Location Number, a 13-digit string. GS1 GTIN Executive Summaryduns
(string): Dun & Bradstreet Data Universal Numbering System number, a 9-digit stringaddress
(object):streetAddress1
(string): Physical street address line 1 informationstreetAddress2
(string): Physical street address line 2 information, if applicablecity
(string): City locationstate
(string): State or region locationpostalCode
(string): ZIP or postal codecountry
(string): Country locationgeoLocation
optional (object): Consisting of either...gpsCoordinates
as anarray of strings
representing the latitude followed by longitude expressed in degrees and minutes ORgeoFence
as anarray of string arrays
representing the latitude followed by longitude expressed in degrees and minutes for each set of coordinates defining the geo fence
Optional
businessUnit
(string): Indicates the business unit associated with the location.market
(string): Indicates the market associated with the location.region
(string): Indicates the region associated with the location.locationType
(string): Indicates whether the location is "Internal", "Supplier", or "Customer"parentLocationId
(string): To create a hierarchy of locations (divisions, regions, etc.), use this field to point to the location’s parent locationglnAssignedBy
(string): Indicates whether it was assigned by "GS1", "GLOBALGAP", "Internal", "Trading Partner", or "Other"alternateLocationCode
(string): This field provides sender and shipper to use and alternate identifier for connecting locations. This could be a URL, a UUID, or other globally unique identification scheme. The important thing is that it is unique per location and is shared between shipper and receiver. For example, this could be a GS1 Digital Link or Google Place IDphoneNumber
(string)*: Phone number including country code with format: +1.999.999.999 *This field is required ifaddress
is used to identify locationisPrimaryLocation
(boolean): This indicates that the location is the primary headquarter location for the organizationisCoveredByGdst
(boolean): Indicates that this location is covered by the Global Dialogue on Seafood Traceability requirements
Sample Payload
{
"locationMasterList": {
"locationName": "Central Distribution Center",
"locationCode": "CDC001",
"businessUnit": "01",
"market": "North",
"region": "03",
"locationType": "Internal",
"parentLocationId": "HQ001",
"gln": "1234567890123",
"glnAssignedBy": "GS1",
"duns": "123456789",
"alternateLocationCode": "CDC-ALT",
"phoneNumber": "+1-800-555-0199",
"isPrimaryLocation": true,
"isCoveredByGdst": false,
"address": {
"streetAddress1": "123 Main St",
"streetAddress2": "Suite 100",
"city": "Springfield",
"state": "IL",
"postalCode": "62701",
"country": "US"
},
"geoLocation": {
"gpsCoordinates": [
"86.271142",
"-79.593557"
],
"geoFence": [
[
"40.28",
"-84.15"
],
[
"40.29",
"-84.14"
],
[
"40.27",
"-84.14"
]
]
}
}
}
Response
- 200
- 400
Location data ingested successfully
{
"request_ids": [
"1abc2f7e-6ca2-40ec-9566-19a850945d7f"
]
}
Description of what user-fixable validation error occurred and in what part of the payload
{
"detail": "'locationCode' is a required property - 'locationMasterList.0'",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}